legacy: support date: archive patterns for --from-borg1 - #9969
Merged
Conversation
The date: archive matching pattern (#8776) was implemented for borg2 repos in manifest.py but not in the legacy code path used by borg2 repo-list/transfer --from-borg1, so date: patterns matched no archives when filtering legacy (borg 1.x) repos. Add the same date: branch to LegacyArchives._matching_info_tuples, mirroring the borg2 implementation. Fixes #9949 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
date:archive-matching pattern (#8776) works for borg2 repos but not when filtering legacy (borg 1.x) repos via--from-borg1— e.g.borg2 repo-list --from-borg1 -a 'date:2026-03'returns no matching archives even when matches exist. Reported in #9949.The pattern is implemented in
Archives._matching_info_tuples(manifest.py) but the correspondingLegacyArchives._matching_info_tuples(legacy/archives.py) handlesaid:,tags:,user:,host:and name matching only — it silently falls through to name matching fordate:, matching nothing.Fix
Add the same
date:branch toLegacyArchives._matching_info_tuples, mirroring the borg2 implementation (compile_date_pattern/DatePatternError→CommandError). This is especially useful forborg2 transfer --from-borg1.Tests
Added
test_list_match_dateandtest_list_match_date_invalid_raisestolegacy_archives_test.py, alongside the existinguser:/host:/tags:match tests.legacy_archives_test.py: 52 passedmatch_archives_date_test.py(existing date suite): 34 passed, no regressionFixes #9949
🤖 Generated with Claude Code